package com.learn.springbootcache.mapper;

import com.learn.springbootcache.bean.Org;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @author Jmy
 */
@Mapper
@Repository
public interface OrgMapper {

    @Select("SELECT * FROM org WHERE id = #{id}")
    Org getOrgById(Integer id);

    @Update("UPDATE org SET org_name = #{orgName}, org_code = #{orgCode} WHERE id = #{id}")
    int updateOrgById(Org org);

    @Delete("DELETE FROM org WHERE id = #{id}")
    int delOrg(Integer id);
}

